
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>分布式文件系统FastDFS - 学习卡片</title>
      <style>
        body { font-family: sans-serif; background-color: #f0f8ff; color: #333; display: flex; flex-direction: column; align-items: center; padding: 50px 20px; }
        .header h1 { font-size: 32px; }
        .grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; width: 100%; max-width: 1200px; }
        .card-container { perspective: 1200px; cursor: pointer; height: 250px; }
        .card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.7s; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
        .card-container.flipped .card { transform: rotateY(180deg); }
        .card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; flex-direction: column; box-sizing: border-box; border-radius: 16px; background-color: #fff; padding: 24px; }
        .card-back { background-color: #f0fff4; transform: rotateY(180deg); justify-content: space-between; }
        .card-category { font-size: 14px; color: #0052d9; margin-bottom: 8px; font-weight: 500; }
        .card-question { font-size: 20px; font-weight: 500; flex-grow: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
        .card-answer-wrapper { flex-grow: 1; overflow-y: auto; }
        .card-answer { font-size: 15px; line-height: 1.7; }
        .card-footer { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 16px; margin-top: 16px; }
        .card-source { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 12px; margin-top: 12px; }
      </style>
    </head>
    <body>
      <div class="header">
        <h1>分布式文件系统FastDFS - 学习卡片</h1>
      </div>
      <div class="grid-container">
        
    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">理论</div>
          <div class="card-question">FastDFS是什么？它主要解决了什么问题，并具备哪些核心特点？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">理论</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">FastDFS是一个开源的分布式文件系统，用于解决大规模分布式存储系统中的文件存储和访问问题。其核心特点包括：1. 分布式存储；2. 高性能；3. 扩展性；4. 负载均衡。</div>
          </div>
          <div class="card-source">来源: 1.什么是FastDFS</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">架构</div>
          <div class="card-question">FastDFS的架构包含哪两个核心角色？它们各自的作用分别是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">架构</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">FastDFS架构包括Tracker server和Storage server。Tracker server（追踪服务器或调度服务器）的作用是负载均衡和调度。Storage server（存储服务器）的作用是文件存储，客户端上传的文件最终存储在Storage服务器上。</div>
          </div>
          <div class="card-source">来源: 2.FastDFS架构</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">在文件上传流程中，当Tracker server选定一个存储group后，它会使用哪些规则来选择具体的storage server？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">当选定group后，tracker支持三种选择storage server的规则：1. Round robin（在group内的所有storage间轮询）；2. First server ordered by ip（按ip排序）；3. First server ordered by priority（按优先级排序）。</div>
          </div>
          <div class="card-source">来源: 3 文件上传流程</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">原理</div>
          <div class="card-question">在FastDFS中，“group”（分组）的概念是什么？它在系统中起到了什么作用？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">原理</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">存储系统由一个或多个group组成，group之间的文件相互独立。一个group可以由一台或多台存储服务器组成，group内各服务器的文件相同，起到冗余备份和负载均衡的作用。系统容量可以通过动态添加新的group来扩展。</div>
          </div>
          <div class="card-source">来源: 4.FastDFS原理</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">FastDFS最终生成的文件名由哪些部分拼接而成？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">文件名由group（组名）、存储目录（虚拟磁盘路径）、两级子目录、fileid、以及文件后缀名拼接而成。</div>
          </div>
          <div class="card-source">来源: 3 文件上传流程</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">在使用Docker运行storage服务容器时，如何指定其关联的Tracker Server地址？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">通过在 `docker run` 命令中使用 `-e TRACKER_SERVER=IP:PORT` 环境变量来指定Tracker Server的地址。例如：`-e TRACKER_SERVER=192.168.189.137:22122`。</div>
          </div>
          <div class="card-source">来源: 5. Docker安装FastDFS</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">在文件上传时，Tracker server为文件分配存储group支持哪几种规则？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">支持三种选择group的规则：1. Round robin (所有的group间轮询)；2. Specified group (指定某一个确定的group)；3. Load balance (剩余存储空间多的group优先)。</div>
          </div>
          <div class="card-source">来源: 3 文件上传流程</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">特性</div>
          <div class="card-question">为什么说FastDFS的Tracker server内存占用量很少？它在内存中主要记录了哪些信息？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">特性</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">因为它不记录文件索引信息。Tracker server在内存中仅记录分组和Storage server的状态等信息，因此占用的内存量很少。</div>
          </div>
          <div class="card-source">来源: 4.FastDFS原理</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">在SpringBoot项目中整合FastDFS，需要添加哪个关键的Maven依赖？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">需要添加 com.github.tobato 组下的 fastdfs-client 依赖。具体为：`<artifactId>fastdfs-client</artifactId>`。</div>
          </div>
          <div class="card-source">来源: 5. Docker安装FastDFS</div>
        </div>
      </div>
    </div>

      </div>
    </body>
    </html>
